/**
 * 
 */
package com.vision.core.cl.ui;

import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.sencha.gxt.widget.core.client.form.FieldLabel;

/**
 * Appends a red asterisk to the label's text to indicate that the field is required.
 *  
 * @author Mark
 *
 */
public class RequiredFieldLabel extends FieldLabel {
	
	public RequiredFieldLabel() {
		
	}
	
	@Override
	public void setText(String text) {
		super.setHTML( SafeHtmlUtils.fromTrustedString(text + "<span style='color: red'> *</span>") );
	}

	public void setHTML(SafeHtml html) {
		super.setHTML( SafeHtmlUtils.fromTrustedString(html.asString() + "<span style='color: red'> *</span>") );
	}
	
}
